package com.zgjkhis.modules.system.domain;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.zgjkhis.domain.BaseDomain;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;

import java.util.Date;

/**
* @date 2020-05-14
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("schedule")
public class Schedule extends BaseDomain {

    /** ID */
    @TableId
    private Long id;

    @ApiModelProperty(value = "事件名称")
    @Length(min=0,max=50,message = "事件名称需要在50字以内")
    private String contentName;
    @ApiModelProperty(value = "状态 1未完成 2已完成 3已取消")
    private Integer status;
    @ApiModelProperty(value = "事件内容")
    @Length(min=0,max=500,message = "事件内容需要在500字以内")
    private String content;
    @ApiModelProperty(value = "预计时间")
    @TableField(fill= FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private Date planTime;
    @ApiModelProperty(value = "备注")
    private String remark;
    @ApiModelProperty(value = "创建人")
    private String createUserId;
    @ApiModelProperty(value = "创建人姓名")
    @Length(min=0,max=50,message = "负责人需要在50字以内")
    private String createUserName;
    @ApiModelProperty(value = "负责人")
    private String responsibleUserId;
    @ApiModelProperty(value = "负责人姓名")
    private String responsibleUserName;
    @ApiModelProperty(value = "操作人")
    private String updateUserId;
    @ApiModelProperty(value = "操作人姓名")
    private String updateUserName;
    @ApiModelProperty(value = "完成")
    @TableField(fill= FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private Date completeTime;
    @ApiModelProperty(value = "门店id")
    private String pharmacyId;


    public void copy(Schedule source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
